﻿using System;
using System.IO;
using NazTek.Documenter.Ssis.Control;
using NazTek.Documenter.Ssis.View.Properties;

namespace NazTek.Documenter.Ssis.View
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            const string targetDir = "Output";
            if (!Directory.Exists(targetDir))
                Directory.CreateDirectory(targetDir);
            const string stylePath = @"Output\Code.css";
            if (!File.Exists(stylePath))
                File.WriteAllText(stylePath, Resources.Code);
            foreach (var doc in new SsisPackageManager(args).GetDoc())
            {
                var path = string.Format(@"{0}\{1}", targetDir, doc.Key);
                File.WriteAllText(path, doc.Value);
            }

            Console.WriteLine(
                @"Documentation complete.  HTML documentation files have been created in the Output directory.");
            Console.ReadLine();
        }
    }
}